<?php $this->deleteByCheckbox('.deleteSubject',$this->baseUrl() . '/subject/delete','.message');?>
<div class="adminPanel">
	Správca predmetov | 
	<a href="<?= $this->url(array('controller' => 'subject','action' => 'add'))?>">Pridať predmet</a>
	<a href="#" class="deleteSubject">Odstrániť</a>	
</div>
<div class="message"></div>
<form name="checkbox">
<table>
<tr>	
	<th></th>
	<th>Meno predmetu</th>
	<th>Počet otázok</th>
	<th></th>	
</tr>
<?php 
	$i = 0;
	foreach ($this->subjects as $subject):
	$i++;
	$class = ($i % 2 == 0) ? 'class="even"' : '';
?>
	<tr id="<?= $subject->sid ?>" <?= $class ?>>
		<td><input type="checkbox" name="<?= $subject->sid ?>" value="<?= $subject->sid ?>"></td>
		<td><?= $subject->name ?></td>
		<td><?= $this->questionsCount[$subject->sid] ?></td>
		<td><a href="<?= $this->url(array(
					'controller' => 'question',
					'action' => 'index',
					'sid' => $subject->sid
				))?>">Spravovať otázky</a>
		</td>
<?php endforeach;?>
</table>
</form>